//
//  CTabView.h
//  HCHK_iphone
//
//  Created by yilong zhang on 11-12-7.
//  Copyright 2011年 __MyCompanyName__. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <QuartzCore/QuartzCore.h>
#import "CGalleryView.h"

#define DRAWER_HEIGHT   31
#define DRAWER_WIDTH    31
#define TAB_HEIGHT      50
#define GALLERY_HEIGHT  58

@protocol TabBarDelegate <NSObject>

@optional
-(void)TabBarClickIndex:(int)index;
-(void)DidTabBarFocusSeted:(int)index;

@end

@interface CTabBar : UIView

@property (nonatomic, assign) id<TabBarDelegate> delegate;

@property (nonatomic, assign) UILabel           *m_SelTitle;
@property (nonatomic, assign) UIView            *m_Panel;
@property (nonatomic, assign) UIImageView       *m_SelView;
@property (nonatomic, assign) UIButton          *m_Btn;
@property (nonatomic, assign) UIButton          *m_FocusBtn;
@property (nonatomic, assign) int               m_nFocus;
@property (nonatomic, assign) int               m_nItemNum;

-(id)initWithFrame:(CGRect)frame Titles:(NSArray*)titles;
-(void)OnButtonDown:(UIButton*)sender;
-(void)AddTabItem:(NSString*)title;
-(void)DelTabItem:(int)index;
-(void)SetSelectedItem:(int)index;
-(void)SetFocus:(int)index;
-(void)DidAddTabItem;

@end

@protocol TabViewDelegate <NSObject>

@optional
-(void)TabViewClickIndex:(int)index;
-(void)DidTabFocusSeted:(int)index;
-(void)TabViewIsOpended:(BOOL)istate;

@end

@interface CTabView : UIView <TabBarDelegate>

@property (nonatomic, assign) id<TabViewDelegate> delegate;
@property (nonatomic, assign) UIButton      *m_Switch;
@property (nonatomic, assign) CTabBar       *m_Tab;
@property (nonatomic, assign) UIView        *m_TabPanel;
@property (nonatomic, assign) CGalleryView  *m_Gallery;
@property (nonatomic, assign) BOOL          m_bIsShow;

-(void)InitTabView;
-(void)ResetTabView;
-(void)OnButtonDown:(UIButton*)sender;
-(void)CloseTabView;
-(void)OpenTabView;
-(void)DidCloseShow;
-(void)ShowIndicator;
-(void)HiddenIndicator;

@end
